<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>原子习惯 - 数据统计</title>
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css">
  <link rel="stylesheet" href="css/styles.css">
</head>
<body>
  <div class="container">
    <div class="status-bar">
      <div class="time">9:41</div>
      <div class="icons">
        <i class="fas fa-signal"></i>
        <i class="fas fa-wifi"></i>
        <i class="fas fa-battery-full"></i>
      </div>
    </div>
    
    <div class="nav-bar">
      <div class="title">数据统计</div>
      <div class="action">
        <i class="fas fa-calendar-alt"></i>
      </div>
    </div>
    
    <div class="screen-container">
      <!-- Time Period Selector -->
      <div class="period-selector">
        <button class="period-btn">日</button>
        <button class="period-btn active">周</button>
        <button class="period-btn">月</button>
        <button class="period-btn">年</button>
      </div>
      
      <!-- Overall Stats -->
      <div class="card">
        <h3>总体完成率</h3>
        <div class="chart-placeholder large">
          <div class="chart-progress">
            <div class="chart-circle">
              <div class="percentage">87%</div>
              <div class="label">总体完成率</div>
            </div>
          </div>
        </div>
        
        <div class="stats-grid">
          <div class="stat-item">
            <div class="stat-value">36</div>
            <div class="stat-label">活跃天数</div>
          </div>
          <div class="stat-item">
            <div class="stat-value">21</div>
            <div class="stat-label">最长连续</div>
          </div>
          <div class="stat-item">
            <div class="stat-value">5</div>
            <div class="stat-label">习惯总数</div>
          </div>
          <div class="stat-item">
            <div class="stat-value">152</div>
            <div class="stat-label">完成次数</div>
          </div>
        </div>
      </div>
      
      <!-- Weekly Trend -->
      <div class="card">
        <h3>习惯趋势</h3>
        <div class="chart-placeholder">
          <div class="bar-chart">
            <div class="bar-chart-y-axis">
              <div>100%</div>
              <div>75%</div>
              <div>50%</div>
              <div>25%</div>
              <div>0%</div>
            </div>
            <div class="bar-chart-bars">
              <div class="bar-container">
                <div class="bar-column" style="height: 70%"></div>
                <div class="bar-label">一</div>
              </div>
              <div class="bar-container">
                <div class="bar-column" style="height: 90%"></div>
                <div class="bar-label">二</div>
              </div>
              <div class="bar-container">
                <div class="bar-column" style="height: 100%"></div>
                <div class="bar-label">三</div>
              </div>
              <div class="bar-container">
                <div class="bar-column" style="height: 85%"></div>
                <div class="bar-label">四</div>
              </div>
              <div class="bar-container">
                <div class="bar-column" style="height: 75%"></div>
                <div class="bar-label">五</div>
              </div>
              <div class="bar-container">
                <div class="bar-column" style="height: 95%"></div>
                <div class="bar-label">六</div>
              </div>
              <div class="bar-container">
                <div class="bar-column" style="height: 80%"></div>
                <div class="bar-label">日</div>
              </div>
            </div>
          </div>
        </div>
      </div>
      
      <!-- Habit Progress -->
      <div class="card">
        <h3>习惯进度</h3>
        
        <div class="habit-progress-item">
          <div class="habit-progress-header">
            <div class="habit-name">晨间冥想</div>
            <div class="habit-progress-percentage">93%</div>
          </div>
          <div class="progress">
            <div class="progress-bar" style="width: 93%;"></div>
          </div>
        </div>
        
        <div class="habit-progress-item">
          <div class="habit-progress-header">
            <div class="habit-name">阅读</div>
            <div class="habit-progress-percentage">87%</div>
          </div>
          <div class="progress">
            <div class="progress-bar" style="width: 87%;"></div>
          </div>
        </div>
        
        <div class="habit-progress-item">
          <div class="habit-progress-header">
            <div class="habit-name">喝水</div>
            <div class="habit-progress-percentage">100%</div>
          </div>
          <div class="progress">
            <div class="progress-bar" style="width: 100%;"></div>
          </div>
        </div>
        
        <div class="habit-progress-item">
          <div class="habit-progress-header">
            <div class="habit-name">运动</div>
            <div class="habit-progress-percentage">75%</div>
          </div>
          <div class="progress">
            <div class="progress-bar" style="width: 75%;"></div>
          </div>
        </div>
        
        <div class="habit-progress-item">
          <div class="habit-progress-header">
            <div class="habit-name">写日记</div>
            <div class="habit-progress-percentage">80%</div>
          </div>
          <div class="progress">
            <div class="progress-bar" style="width: 80%;"></div>
          </div>
        </div>
      </div>
      
      <!-- Insights -->
      <div class="card">
        <h3>洞察</h3>
        
        <div class="insight-item">
          <div class="insight-icon">
            <i class="fas fa-award text-primary"></i>
          </div>
          <div class="insight-content">
            <div class="insight-title">最佳习惯</div>
            <div class="insight-description">
              <strong>喝水</strong>是你最坚持的习惯，已连续完成32天！
            </div>
          </div>
        </div>
        
        <div class="insight-item">
          <div class="insight-icon">
            <i class="fas fa-clock text-primary"></i>
          </div>
          <div class="insight-content">
            <div class="insight-title">高效时段</div>
            <div class="insight-description">
              你在<strong>早上6:00-9:00</strong>的习惯完成率最高（95%）
            </div>
          </div>
        </div>
        
        <div class="insight-item">
          <div class="insight-icon">
            <i class="fas fa-exclamation-triangle text-warning"></i>
          </div>
          <div class="insight-content">
            <div class="insight-title">需要关注</div>
            <div class="insight-description">
              <strong>运动</strong>习惯的坚持率有所下降，近期完成率75%。
            </div>
          </div>
        </div>
      </div>
      
      <!-- Export Data -->
      <div class="card">
        <div class="flex flex-between">
          <div>
            <h3>导出数据</h3>
            <p class="text-secondary">导出你的习惯数据进行分析</p>
          </div>
          <button class="btn btn-outline">
            <i class="fas fa-download"></i> 导出
          </button>
        </div>
      </div>
    </div>
    
    <!-- Tab Bar -->
    <div class="tab-bar">
      <div class="tab-item" data-nav="dashboard.html">
        <i class="fas fa-home"></i>
        <span>首页</span>
      </div>
      <div class="tab-item" data-nav="templates.html">
        <i class="fas fa-list-ul"></i>
        <span>模板</span>
      </div>
      <div class="tab-item active">
        <i class="fas fa-chart-pie"></i>
        <span>统计</span>
      </div>
      <div class="tab-item" data-nav="community.html">
        <i class="fas fa-users"></i>
        <span>社区</span>
      </div>
      <div class="tab-item" data-nav="profile.html">
        <i class="fas fa-user"></i>
        <span>我的</span>
      </div>
    </div>
  </div>

  <style>
    /* Analytics specific styles */
    .period-selector {
      display: flex;
      justify-content: space-between;
      background-color: var(--card-color);
      border-radius: 10px;
      overflow: hidden;
      margin-bottom: 15px;
    }
    
    .period-btn {
      flex: 1;
      padding: 10px;
      background: none;
      border: none;
      font-family: var(--ios-font);
      font-size: 14px;
      color: var(--text-color);
      cursor: pointer;
    }
    
    .period-btn.active {
      background-color: var(--primary-color);
      color: white;
    }
    
    .chart-placeholder.large {
      height: 250px;
    }
    
    .chart-progress {
      width: 100%;
      height: 100%;
      display: flex;
      justify-content: center;
      align-items: center;
    }
    
    .chart-circle {
      width: 150px;
      height: 150px;
      border-radius: 50%;
      background: conic-gradient(var(--primary-color) 0% 87%, var(--border-color) 87% 100%);
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      position: relative;
    }
    
    .chart-circle::before {
      content: "";
      position: absolute;
      top: 10px;
      left: 10px;
      right: 10px;
      bottom: 10px;
      background-color: white;
      border-radius: 50%;
    }
    
    .chart-circle .percentage {
      position: relative;
      font-size: 36px;
      font-weight: 700;
      color: var(--text-color);
    }
    
    .chart-circle .label {
      position: relative;
      font-size: 12px;
      color: var(--text-secondary);
    }
    
    .stats-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 15px;
      margin-top: 20px;
    }
    
    .stat-item {
      text-align: center;
      padding: 10px;
      background-color: var(--background-color);
      border-radius: 10px;
    }
    
    .stat-value {
      font-size: 24px;
      font-weight: 600;
      color: var(--primary-color);
    }
    
    .stat-label {
      font-size: 14px;
      color: var(--text-secondary);
    }
    
    .bar-chart {
      width: 100%;
      height: 200px;
      display: flex;
      align-items: flex-end;
    }
    
    .bar-chart-y-axis {
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      height: 180px;
      padding-right: 10px;
      color: var(--text-secondary);
      font-size: 12px;
    }
    
    .bar-chart-bars {
      display: flex;
      flex: 1;
      height: 180px;
      align-items: flex-end;
      justify-content: space-around;
    }
    
    .bar-container {
      display: flex;
      flex-direction: column;
      align-items: center;
      width: 30px;
    }
    
    .bar-column {
      width: 25px;
      background-color: var(--primary-color);
      border-radius: 5px 5px 0 0;
    }
    
    .bar-label {
      margin-top: 5px;
      font-size: 12px;
      color: var(--text-secondary);
    }
    
    .habit-progress-item {
      margin-bottom: 15px;
    }
    
    .habit-progress-header {
      display: flex;
      justify-content: space-between;
      margin-bottom: 5px;
    }
    
    .habit-name {
      font-weight: 500;
    }
    
    .habit-progress-percentage {
      color: var(--primary-color);
      font-weight: 600;
    }
    
    .insight-item {
      display: flex;
      margin-bottom: 15px;
    }
    
    .insight-icon {
      width: 40px;
      height: 40px;
      background-color: var(--background-color);
      border-radius: 10px;
      display: flex;
      justify-content: center;
      align-items: center;
      margin-right: 15px;
      font-size: 20px;
    }
    
    .insight-title {
      font-weight: 600;
      margin-bottom: 5px;
    }
    
    .insight-description {
      color: var(--text-secondary);
      font-size: 14px;
    }
  </style>
  
  <script src="js/app.js"></script>
</body>
</html>
